package com.szjk.core.utils;

import com.szjk.core.constant.Constant;
import com.szjk.core.vo.ResultEntity;

/**
 * @author chenxinglin
 * @version 1.0
 * @description
 * @date 2021-11-26 09:48
 * @company szjk
 */
public class ResultUtils {

    public static ResultEntity success(){
        return new ResultEntity(Constant.SUCCESS_CODE, null, "成功");
    }

    public static ResultEntity success(Object data){
        return new ResultEntity(Constant.SUCCESS_CODE, data, "成功");
    }

    public static ResultEntity success(String message){
        return new ResultEntity(Constant.SUCCESS_CODE, null, message);
    }

    public static ResultEntity error(){
        return new ResultEntity(Constant.FAIL_CODE, null, "系统异常");
    }

    public static ResultEntity error(Object data){
        return new ResultEntity(Constant.FAIL_CODE, data, "系统异常");
    }

    public static ResultEntity error(String message){
        return new ResultEntity(Constant.FAIL_CODE, null, message);
    }

    public static ResultEntity serviceStopError(String message){
        return new ResultEntity(Constant.SERVICE_STOP_CODE, null, message);
    }

}
